function getAge(date){
	if(!date){
		return ''
	}
	let time =new Date().getTime() - new Date(date).getTime();
	// let year = new Date().getFullYear() - new Date(date).getFullYear();
	let year =Math.floor(time/1000/3600/24/365);
	if(year <1){
		let month = Math.floor(time/1000/3600/24/30);
		if(month<1) {
			let day = Math.floor(time/1000/3600/24);
			return day + '天'
		}else{
			return month + '个月'
		}
	}else{
		year = new Date().getFullYear() - new Date(date).getFullYear();
		return year+ '岁'
	}
}

export default getAge